#!/bin/bash
STREAM=/home/hadoop/hadoop/hadoop_install/contrib/streaming
#==============================================
MAPPER=/home/hadoop/progs/python/random_mapper.py
IDENTITY_MAPPER=org.apache.hadoop.mapred.lib.IdentityMapper
REDUCER=/home/hadoop/progs/python/random_reducer.py
FILE=/home/hadoop/progs/python/mylib.py
#==============================================
INPUT=/home/lih307/sandbox/
OUTPUT=/home/lih307/sandbox_output1
#==============================================
REDUCE_NUM=2
#=============================================
hadoop fs -rmr $OUTPUT
hadoop jar $STREAM/hadoop-streaming-1.0.3.jar \
    -D mapred.reduce.tasks=$REDUCE_NUM \
    -input $INPUT \
    -output $OUTPUT \
    -mapper $MAPPER \
    -reducer $REDUCER \
    -file $MAPPER \
    -file $REDUCER \
    -file $FILE